home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 December / MACPOWER-1997-12.ISO.7z / MACPOWER-1997-12.ISO / AMUG / PROGRAMMING / Raven 1.2.sit / Raven 1.2 / • Extras • / Display Manager / INTO Universal Headers / Video.h < prev    next >
Text File  |  1995-06-14  |  29KB  |  722 lines

  1. /*
  2.      File:        Video.h
  3.  
  4.      Contains:    Video Driver Interfaces.
  5.  
  6.      Version:    Technology:    
  7.                  Package:    Universal Interfaces.  5/25/95.
  8.                 Revision:    31.
  9.  
  10.      Copyright:    ゥ 1984-1995 by Apple Computer, Inc.
  11.                  All rights reserved.
  12.  
  13.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  14.                  stack.  Include the file and version information (from above)
  15.                  in the problem description and send to:
  16.                      Internet:    apple.bugs@applelink.apple.com
  17.                      AppleLink:    APPLE.BUGS
  18.  
  19. */
  20.  
  21. #ifndef __VIDEO__
  22. #define __VIDEO__
  23.  
  24.  
  25. #ifndef __QUICKDRAW__
  26. #include <Quickdraw.h>
  27. #endif
  28. /*    #include <Types.h>                                            */
  29. /*        #include <ConditionalMacros.h>                            */
  30. /*    #include <MixedMode.h>                                        */
  31. /*    #include <QuickdrawText.h>                                    */
  32.  
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36.  
  37. #if PRAGMA_ALIGN_SUPPORTED
  38. #pragma options align=mac68k
  39. #endif
  40.  
  41. #if PRAGMA_IMPORT_SUPPORTED
  42. #pragma import on
  43. #endif
  44.  
  45.  
  46. enum {
  47.     mBaseOffset                    = 1,                            /*Id of mBaseOffset.*/
  48.     mRowBytes                    = 2,                            /*Video sResource parameter Id's */
  49.     mBounds                        = 3,                            /*Video sResource parameter Id's */
  50.     mVersion                    = 4,                            /*Video sResource parameter Id's */
  51.     mHRes                        = 5,                            /*Video sResource parameter Id's */
  52.     mVRes                        = 6,                            /*Video sResource parameter Id's */
  53.     mPixelType                    = 7,                            /*Video sResource parameter Id's */
  54.     mPixelSize                    = 8,                            /*Video sResource parameter Id's */
  55.     mCmpCount                    = 9,                            /*Video sResource parameter Id's */
  56.     mCmpSize                    = 10,                            /*Video sResource parameter Id's */
  57.     mPlaneBytes                    = 11,                            /*Video sResource parameter Id's */
  58.     mVertRefRate                = 14,                            /*Video sResource parameter Id's */
  59.     mVidParams                    = 1,                            /*Video parameter block id.*/
  60.     mTable                        = 2,                            /*Offset to the table.*/
  61.     mPageCnt                    = 3,                            /*Number of pages*/
  62.     mDevType                    = 4,                            /*Device Type*/
  63.     oneBitMode                    = 128,                            /*Id of OneBitMode Parameter list.*/
  64.     twoBitMode                    = 129,                            /*Id of TwoBitMode Parameter list.*/
  65.     fourBitMode                    = 130,                            /*Id of FourBitMode Parameter list.*/
  66.     eightBitMode                = 131                            /*Id of EightBitMode Parameter list.*/
  67. };
  68.  
  69. enum {
  70.     sixteenBitMode                = 132,                            /*Id of SixteenBitMode Parameter list.*/
  71.     thirtyTwoBitMode            = 133,                            /*Id of ThirtyTwoBitMode Parameter list.*/
  72.     firstVidMode                = 128,                            /*The new, better way to do the above. */
  73.     secondVidMode                = 129,                            /* QuickDraw only supports six video */
  74.     thirdVidMode                = 130,                            /* at this time.      */
  75.     fourthVidMode                = 131,
  76.     fifthVidMode                = 132,
  77.     sixthVidMode                = 133,
  78.     spGammaDir                    = 64,
  79.     spVidNamesDir                = 65
  80. };
  81.  
  82. /* csTimingFormat values in VDTimingInfo */
  83. /* look in the declaration rom for timing info */
  84. enum {
  85.     kDeclROMtables                = 'decl'
  86. };
  87.  
  88. /* Timing mode constants for Display Manager MultiMode support
  89.     Corresponding    .h equates are in Video.h
  90.                     .a equates are in Video.a
  91.                     .r equates are in DepVideoEqu.r
  92.     
  93.     The first enum is the old names (for compatibility).
  94.     The second enum is the new names.
  95. */
  96. enum {
  97.     timingApple12                = 130,                            /*  512x384 (60 Hz) Rubik timing.*/
  98.     timingApple12x                = 135,                            /*  560x384 (60 Hz) Rubik-560 timing.*/
  99.     timingApple13                = 140,                            /*  640x480 (67 Hz) HR timing.*/
  100.     timingApple13x                = 145,                            /*  640x400 (67 Hz) HR-400 timing.*/
  101.     timingAppleVGA                = 150,                            /*  640x480  (60 Hz) VGA timing.*/
  102.     timingApple15                = 160,                            /*  640x870 (75 Hz) FPD timing.*/
  103.     timingApple15x                = 165,                            /*  640x818 (75 Hz) FPD-818 timing.*/
  104.     timingApple16                = 170,                            /*  832x624 (75 Hz) GoldFish timing.*/
  105.     timingAppleSVGA                = 180,                            /*  800x600  (56 Hz) SVGA timing.*/
  106.     timingApple1Ka                = 190,                            /* 1024x768 (60 Hz) VESA 1K-60Hz timing.*/
  107.     timingApple1Kb                = 200,                            /* 1024x768 (70 Hz) VESA 1K-70Hz timing.*/
  108.     timingApple19                = 210,                            /* 1024x768  (75 Hz) Apple 19" RGB.*/
  109.     timingApple21                = 220                            /* 1152x870  (75 Hz) Apple 21" RGB.*/
  110. };
  111.  
  112. enum {
  113.     timingInvalid                = 0,                            /* Unknown timingノ force user to confirm.*/
  114.     timingApple_512x384_60hz    = 130,                            /*  512x384  (60 Hz) Rubik timing.*/
  115.     timingApple_560x384_60hz    = 135,                            /*  560x384  (60 Hz) Rubik-560 timing.*/
  116.     timingApple_640x480_67hz    = 140,                            /*  640x480  (67 Hz) HR timing.*/
  117.     timingApple_640x400_67hz    = 145,                            /*  640x400  (67 Hz) HR-400 timing.*/
  118.     timingVESA_640x480_60hz        = 150,                            /*  640x480  (60 Hz) VGA timing.*/
  119.     timingApple_640x870_75hz    = 160,                            /*  640x870  (75 Hz) FPD timing.*/
  120.     timingApple_640x818_75hz    = 165,                            /*  640x818  (75 Hz) FPD-818 timing.*/
  121.     timingApple_832x624_75hz    = 170,                            /*  832x624  (75 Hz) GoldFish timing.*/
  122.     timingVESA_800x600_56hz        = 180,                            /*  800x600  (56 Hz) SVGA timing.*/
  123.     timingVESA_800x600_60hz        = 182,                            /*  800x600  (60 Hz) SVGA timing.*/
  124.     timingVESA_800x600_72hz        = 184,                            /*  800x600  (72 Hz) SVGA timing.*/
  125.     timingVESA_800x600_75hz        = 186,                            /*  800x600  (75 Hz) SVGA timing.*/
  126.     timingVESA_1024x768_60hz    = 190,                            /* 1024x768  (60 Hz) VESA 1K-60Hz timing.*/
  127.     timingVESA_1024x768_70hz    = 200,                            /* 1024x768  (70 Hz) VESA 1K-70Hz timing.*/
  128.     timingVESA_1024x768_75hz    = 204,                            /* 1024x768  (75 Hz) VESA 1K-70Hz timing (very similar to timingApple_1024x768_75hz).*/
  129.     timingApple_1024x768_75hz    = 210,                            /* 1024x768  (75 Hz) Apple 19" RGB.*/
  130.     timingApple_1152x870_75hz    = 220,                            /* 1152x870  (75 Hz) Apple 21" RGB.*/
  131.     timingAppleNTSC_ST            = 230,                            /*  512x384  (60 Hz, interlaced, non-convolved).*/
  132.     timingAppleNTSC_FF            = 232,                            /*  640x480  (60 Hz, interlaced, non-convolved).*/
  133.     timingAppleNTSC_STconv        = 234,                            /*  512x384  (60 Hz, interlaced, convolved).*/
  134.     timingAppleNTSC_FFconv        = 236,                            /*  640x480  (60 Hz, interlaced, convolved).*/
  135.     timingApplePAL_ST            = 238,                            /*  640x480  (50 Hz, interlaced, non-convolved).*/
  136.     timingApplePAL_FF            = 240,                            /*  768x576  (50 Hz, interlaced, non-convolved).*/
  137.     timingApplePAL_STconv        = 242,                            /*  640x480  (50 Hz, interlaced, convolved).*/
  138.     timingApplePAL_FFconv        = 244,                            /*  768x576  (50 Hz, interlaced, convolved).*/
  139.     timingVESA_1280x960_75hz    = 250,                            /* 1280x960  (75 Hz)*/
  140.     timingVESA_1280x1024_60hz    = 260,                            /* 1280x1024 (60 Hz)*/
  141.     timingVESA_1280x1024_75hz    = 262,                            /* 1280x1024 (75 Hz)*/
  142.     timingVESA_1600x1200_60hz    = 280,                            /* 1600x1200 (60 Hz) VESA proposed timing.*/
  143.     timingVESA_1600x1200_65hz    = 282,                            /* 1600x1200 (65 Hz) VESA proposed timing.*/
  144.     timingVESA_1600x1200_70hz    = 284,                            /* 1600x1200 (70 Hz) VESA proposed timing.*/
  145.     timingVESA_1600x1200_75hz    = 286,                            /* 1600x1200 (75 Hz) VESA proposed timing.*/
  146.     timingVESA_1600x1200_80hz    = 288                            /* 1600x1200 (80 Hz) VESA proposed timing (pixel clock is 216 Mhz dot clock).*/
  147. };
  148.  
  149. /* csConnectFlags values in VDDisplayConnectInfo */
  150. enum {
  151.     kAllModesValid                = 0,                            /* All modes not trimmed by primary init are good close enough to try */
  152.     kAllModesSafe                = 1,                            /* All modes not trimmed by primary init are know to be safe */
  153.     kReportsTagging                = 2,                            /* Can detect tagged displays (to identify smart monitors) */
  154.     kHasDirectConnection        = 3,                            /* True implies that driver can talk directly to device (e.g. serial data link via sense lines) */
  155.     kIsMonoDev                    = 4,                            /* Says whether thereユs an RGB (0) or Monochrome (1) connection. */
  156.     kUncertainConnection        = 5,                            /* There may not be a display (no sense lines?). */
  157.     kTaggingInfoNonStandard        = 6,                            /* Set when csConnectTaggedType/csConnectTaggedData are non-standard (i.e., not the Apple CRT sense codes). */
  158.     kReportsDDCConnection        = 7,                            /* Card can do ddc (set kHasDirectConnect && kHasDDCConnect if you actually found a ddc display). */
  159.     kHasDDCConnection            = 8                                /* Card has ddc connect now. */
  160. };
  161.  
  162. /* csDisplayType values in VDDisplayConnectInfo */
  163. enum {
  164.     kUnknownConnect                = 1,                            /* Not sure how weユll use this, but seems like a good idea. */
  165.     kPanelConnect                = 2,                            /* For use with fixed-in-place LCD panels. */
  166.     kPanelTFTConnect            = 2,                            /* Alias for kPanelConnect */
  167.     kFixedModeCRTConnect        = 3,                            /*  For use with fixed-mode (i.e., very limited range) displays. */
  168.     kMultiModeCRT1Connect        = 4,                            /* 320x200 maybe, 12" maybe, 13" (default), 16" certain, 19" maybe, 21" maybe */
  169.     kMultiModeCRT2Connect        = 5,                            /* 320x200 maybe, 12" maybe, 13" certain, 16" (default), 19" certain, 21" maybe */
  170.     kMultiModeCRT3Connect        = 6,                            /* 320x200 maybe, 12" maybe, 13" certain, 16" certain, 19" default, 21" certain */
  171.     kMultiModeCRT4Connect        = 7,                            /* Expansion to large multi mode (not yet used) */
  172.     kModelessConnect            = 8,                            /* Expansion to modeless model (not yet used) */
  173.     kFullPageConnect            = 9,                            /* 640x818 (to get 8bpp in 512K case) and 640x870 (these two only) */
  174.     kVGAConnect                    = 10,                            /* 640x480 VGA default -- question everything else */
  175.     kNTSCConnect                = 11,                            /* NTSC ST (default), FF, STconv, FFconv */
  176.     kPALConnect                    = 12,                            /* PAL ST (default), FF, STconv, FFconv */
  177.     kHRConnect                    = 13,                            /* Straight-6 connect -- 640x480 and 640x400 (to get 8bpp in 256K case) (these two only) */
  178.     kPanelFSTNConnect            = 14,                            /* For use with fixed-in-place LCD FSTN (aka メSupertwistモ) panels */
  179.     kMonoTwoPageConnect            = 15,                            /* 1152x870 Apple color two-page display */
  180.     kColorTwoPageConnect        = 16,                            /* 1152x870 Apple B&W two-page display */
  181.     kColor16Connect                = 17,                            /* 832x624 Apple B&W two-page display */
  182.     kColor19Connect                = 18                            /* 1024x768 Apple B&W two-page display */
  183. };
  184.  
  185. /* csTimingFlags values in VDTimingInfoRec */
  186. enum {
  187.     kModeValid                    = 0,                            /* Says that this mode should NOT be trimmed. */
  188.     kModeSafe                    = 1,                            /* This mode does not need confirmation */
  189.     kModeDefault                = 2,                            /* This is the default mode for this type of connection */
  190.     kModeShowNow                = 3,                            /* This mode should always be shown (even though it may require a confirm) */
  191.     kModeNotResize                = 4,                            /* This mode should not be used to resize the display (eg. mode selects a different connector on card) */
  192.     kModeRequiresPan            = 5,                            /* This mode has more pixels than are actually displayed */
  193.     kModeInterlaced                = 6                                /* This mode is interlaced (single pixel lines look bad). */
  194. };
  195.  
  196. /* csResolutionFlags bit flags for VDResolutionInfoRec */
  197. enum {
  198.     kResolutionHasMultipleDepthSizes = 0                        /* Says that this mode has different csHorizontalPixels, csVerticalLines at different depths (usually slightly larger at lower depths) */
  199. };
  200.  
  201. enum {
  202. /*    Power Mode constants for VDPowerStateRec.powerState.    */
  203.     kAVPowerOff,
  204.     kAVPowerStandby,
  205.     kAVPowerSuspend,
  206.     kAVPowerOn
  207. };
  208.  
  209. enum {
  210. /*    Power Mode masks and bits for VDPowerStateRec.powerFlags.    */
  211.     kPowerStateNeedsRefresh        = 0,
  212.     kPowerStateNeedsRefreshMask    = (1L << 0)
  213. };
  214.  
  215. enum {
  216. /* Control Codes */
  217.     cscReset                    = 0,
  218.     cscKillIO                    = 1,
  219.     cscSetMode                    = 2,
  220.     cscSetEntries                = 3,
  221.     cscSetGamma                    = 4,
  222.     cscGrayPage                    = 5,
  223.     cscGrayScreen                = 5,
  224.     cscSetGray                    = 6,
  225.     cscSetInterrupt                = 7,
  226.     cscDirectSetEntries            = 8,
  227.     cscSetDefaultMode            = 9,
  228.     cscSwitchMode                = 10,
  229.     cscSetSync                    = 11,
  230.     cscSavePreferredConfiguration = 16,
  231.     cscSetHardwareCursor        = 22,
  232.     cscDrawHardwareCursor        = 23,
  233.     cscSetConvolution            = 24,
  234.     cscSetPowerState            = 25,
  235.     cscUnusedCall                = 127                            /* This call used to expend the scrn resource.  Its imbedded data contains more control info */
  236. };
  237.  
  238. enum {
  239. /* Status Codes */
  240.     cscGetMode                    = 2,
  241.     cscGetEntries                = 3,
  242.     cscGetPageCnt                = 4,
  243.     cscGetPages                    = 4,                            /* This is what C&D 2 calls it. */
  244.     cscGetPageBase                = 5,
  245.     cscGetBaseAddr                = 5,                            /* This is what C&D 2 calls it. */
  246.     cscGetGray                    = 6,
  247.     cscGetInterrupt                = 7,
  248.     cscGetGamma                    = 8,
  249.     cscGetDefaultMode            = 9,
  250.     cscGetCurMode                = 10,
  251.     cscGetSync                    = 11,
  252.     cscGetConnection            = 12,                            /* Return information about the connection to the display */
  253.     cscGetModeTiming            = 13,                            /* Return timing info for a mode */
  254.     cscGetModeBaseAddress        = 14,                            /* Return base address information about a particular mode */
  255.     cscGetScanProc                = 15,                            /* QuickTime scan chasing routine */
  256.     cscGetPreferredConfiguration = 16,
  257.     cscGetNextResolution        = 17,
  258.     cscGetVideoParameters        = 18,
  259.     cscGetGammaInfoList            = 20,
  260.     cscRetrieveGammaTable        = 21,
  261.     cscSupportsHardwareCursor    = 22,
  262.     cscGetHardwareCursorDrawState = 23,
  263.     cscGetConvolution            = 24,
  264.     cscGetPowerState            = 25
  265. };
  266.  
  267. /* Bit definitions for the Get/Set Sync call*/
  268. enum {
  269.     kDisableHorizontalSyncBit    = 0,
  270.     kDisableVerticalSyncBit        = 1,
  271.     kDisableCompositeSyncBit    = 2,
  272.     kEnableSyncOnBlue            = 3,
  273.     kEnableSyncOnGreen            = 4,
  274.     kEnableSyncOnRed            = 5,
  275.     kNoSeparateSyncControlBit    = 6,
  276.     kHorizontalSyncMask            = 0x01,
  277.     kVerticalSyncMask            = 0x02,
  278.     kCompositeSyncMask            = 0x04,
  279.     kDPMSSyncMask                = 0x7,
  280.     kSyncOnBlueMask                = 0x08,
  281.     kSyncOnGreenMask            = 0x10,
  282.     kSyncOnRedMask                = 0x20,
  283.     kSyncOnMask                    = 0x38
  284. };
  285.  
  286. enum {
  287. /*    Power Mode constants for translating DPMS modes to Get/SetSync calls.    */
  288.     kDPMSSyncOn                    = 0,
  289.     kDPMSSyncStandby            = 1,
  290.     kDPMSSyncSuspend            = 2,
  291.     kDPMSSyncOff                = 7
  292. };
  293.  
  294. enum {
  295.     kConvolved                    = 0,
  296.     kLiveVideoPassThru            = 1,
  297.     kConvolvedMask                = 0x01,
  298.     kLiveVideoPassThruMask        = 0x02
  299. };
  300.  
  301. struct VPBlock {
  302.     long                            vpBaseOffset;                /*Offset to page zero of video RAM (From minorBaseOS).*/
  303.     short                            vpRowBytes;                    /*Width of each row of video memory.*/
  304.     Rect                            vpBounds;                    /*BoundsRect for the video display (gives dimensions).*/
  305.     short                            vpVersion;                    /*PixelMap version number.*/
  306.     short                            vpPackType;
  307.     long                            vpPackSize;
  308.     long                            vpHRes;                        /*Horizontal resolution of the device (pixels per inch).*/
  309.     long                            vpVRes;                        /*Vertical resolution of the device (pixels per inch).*/
  310.     short                            vpPixelType;                /*Defines the pixel type.*/
  311.     short                            vpPixelSize;                /*Number of bits in pixel.*/
  312.     short                            vpCmpCount;                    /*Number of components in pixel.*/
  313.     short                            vpCmpSize;                    /*Number of bits per component*/
  314.     long                            vpPlaneBytes;                /*Offset from one plane to the next.*/
  315. };
  316. typedef struct VPBlock VPBlock;
  317.  
  318. typedef VPBlock *VPBlockPtr;
  319.  
  320. struct VDEntryRecord {
  321.     Ptr                                csTable;                    /*(long) pointer to color table entry=value, r,g,b:INTEGER*/
  322. };
  323. typedef struct VDEntryRecord VDEntryRecord;
  324.  
  325. typedef VDEntryRecord *VDEntRecPtr;
  326.  
  327. /* Parm block for SetGray control call */
  328. struct VDGrayRecord {
  329.     Boolean                            csMode;                        /*Same as GDDevType value (0=color, 1=mono)*/
  330.     SInt8                            filler;
  331. };
  332. typedef struct VDGrayRecord VDGrayRecord;
  333.  
  334. typedef VDGrayRecord *VDGrayPtr;
  335.  
  336. /* Parm block for SetInterrupt call */
  337. struct VDFlagRecord {
  338.     SInt8                            csMode;
  339.     SInt8                            filler;
  340. };
  341. typedef struct VDFlagRecord VDFlagRecord;
  342.  
  343. typedef VDFlagRecord *VDFlagRecPtr;
  344.  
  345. /* Parm block for SetEntries control call */
  346. struct VDSetEntryRecord {
  347.     ColorSpec                        *csTable;                    /*Pointer to an array of color specs*/
  348.     short                            csStart;                    /*Which spec in array to start with, or -1*/
  349.     short                            csCount;                    /*Number of color spec entries to set*/
  350. };
  351. typedef struct VDSetEntryRecord VDSetEntryRecord;
  352.  
  353. typedef VDSetEntryRecord *VDSetEntryPtr;
  354.  
  355. /* Parm block for SetGamma control call */
  356. struct VDGammaRecord {
  357.     Ptr                                csGTable;                    /*pointer to gamma table*/
  358. };
  359. typedef struct VDGammaRecord VDGammaRecord;
  360.  
  361. typedef VDGammaRecord *VDGamRecPtr;
  362.  
  363. struct VDBaseAddressInfoRec {
  364.     long                            csDevData;                    /* LONGINT - (long) timing mode */
  365.     long                            csDevBase;                    /* LONGINT - (long) base address of the mode */
  366.     short                            csModeReserved;                /* INTEGER - (short) will some day be the depth */
  367.     long                            csModeBase;                    /* LONGINT - (long) reserved */
  368. };
  369. typedef struct VDBaseAddressInfoRec VDBaseAddressInfoRec, *VDBaseAddressInfoPtr;
  370.  
  371. struct VDSwitchInfoRec {
  372.     unsigned short                    csMode;                        /*(word) mode depth*/
  373.     unsigned long                    csData;                        /*(long) functional sResource of mode*/
  374.     unsigned short                    csPage;                        /*(word) page to switch in*/
  375.     Ptr                                csBaseAddr;                    /*(long) base address of page (return value)*/
  376.     unsigned long                    csReserved;                    /*(long) Reserved (set to 0) */
  377. };
  378. typedef struct VDSwitchInfoRec VDSwitchInfoRec;
  379.  
  380. typedef VDSwitchInfoRec *VDSwitchInfoPtr;
  381.  
  382. struct VDTimingInfoRec {
  383.     unsigned long                    csTimingMode;                /* LONGINT - (long) timing mode (a la InitGDevice) */
  384.     unsigned long                    csTimingReserved;            /* LONGINT - (long) reserved */
  385.     unsigned long                    csTimingFormat;                /* LONGINT - (long) what format is the timing info */
  386.     unsigned long                    csTimingData;                /* LONGINT - (long) data supplied by driver */
  387.     unsigned long                    csTimingFlags;                /* LONGINT - (long) mode within device */
  388. };
  389. typedef struct VDTimingInfoRec VDTimingInfoRec;
  390.  
  391. typedef VDTimingInfoRec *VDTimingInfoPtr;
  392.  
  393. struct VDDisplayConnectInfoRec {
  394.     unsigned short                    csDisplayType;                /* INTEGER - (word) Type of display connected */
  395.     unsigned char                    csConnectTaggedType;        /* BYTE - type of tagging */
  396.     unsigned char                    csConnectTaggedData;        /* BYTE - tagging data */
  397.     unsigned long                    csConnectFlags;                /* LONGINT - (long) tell us about the connection */
  398.     unsigned long                    csDisplayComponent;            /* LONGINT - (long) if the card has a direct connection to the display, it returns the display component here (FUTURE) */
  399.     unsigned long                    csConnectReserved;            /* LONGINT - (long) reserved */
  400. };
  401. typedef struct VDDisplayConnectInfoRec VDDisplayConnectInfoRec;
  402.  
  403. typedef VDDisplayConnectInfoRec *VDDisplayConnectInfoPtr;
  404.  
  405. /* RawSenseCode
  406.     This abstract data type is not exactly abstract.  Rather, it is merely enumerated constants
  407.     for the possible raw sense code values when 'standard' sense code hardware is implemented.
  408.  
  409.     For 'standard' sense code hardware, the raw sense is obtained as follows:
  410.         ・ Instruct the frame buffer controller NOT to actively drive any of the monitor sense lines
  411.         ・ Read the state of the monitor sense lines 2, 1, and 0.  (2 is the MSB, 0 the LSB)
  412.  
  413.     IMPORTANT Note: 
  414.     When the 'kTaggingInfoNonStandard' bit of 'csConnectFlags' is FALSE, then these constants 
  415.     are valid 'csConnectTaggedType' values in 'VDDisplayConnectInfo' 
  416.  
  417. */
  418. typedef unsigned char RawSenseCode;
  419.  
  420.  
  421. enum {
  422.     kRSCZero                    = 0,
  423.     kRSCOne                        = 1,
  424.     kRSCTwo                        = 2,
  425.     kRSCThree                    = 3,
  426.     kRSCFour                    = 4,
  427.     kRSCFive                    = 5,
  428.     kRSCSix                        = 6,
  429.     kRSCSeven                    = 7
  430. };
  431.  
  432. /* ExtendedSenseCode
  433.     This abstract data type is not exactly abstract.  Rather, it is merely enumerated constants
  434.     for the values which are possible when the extended sense algorithm is applied to hardware
  435.     which implements 'standard' sense code hardware.
  436.  
  437.      For 'standard' sense code hardware, the extended sense code algorithm is as follows:
  438.     (Note:  as described here, sense line 'A' corresponds to '2', 'B' to '1', and 'C' to '0')
  439.         ・ Drive sense line 'A' low and read the values of 'B' and 'C'.  
  440.         ・ Drive sense line 'B' low and read the values of 'A' and 'C'.
  441.         ・ Drive sense line 'C' low and read the values of 'A' and 'B'.
  442.  
  443.     In this way, a six-bit number of the form BC/AC/AB is generated. 
  444.  
  445.     IMPORTANT Note: 
  446.     When the 'kTaggingInfoNonStandard' bit of 'csConnectFlags' is FALSE, then these constants 
  447.     are valid 'csConnectTaggedData' values in 'VDDisplayConnectInfo' 
  448.  
  449. */
  450. typedef unsigned char ExtendedSenseCode;
  451.  
  452.  
  453. enum {
  454.     kESCZero21Inch                = 0x00,                            /* 21" RGB                                 */
  455.     kESCOnePortraitMono            = 0x14,                            /* Portrait Monochrome                     */
  456.     kESCTwo12Inch                = 0x21,                            /* 12" RGB                                */
  457.     kESCThree21InchRadius        = 0x31,                            /* 21" RGB (Radius)                        */
  458.     kESCThree21InchMonoRadius    = 0x34,                            /* 21" Monochrome (Radius)                 */
  459.     kESCThree21InchMono            = 0x35,                            /* 21" Monochrome                        */
  460.     kESCFourNTSC                = 0x0A,                            /* NTSC                                 */
  461.     kESCFivePortrait            = 0x1E,                            /* Portrait RGB                         */
  462.     kESCSixMSB1                    = 0x03,                            /* MultiScan Band-1 (12" thru 1Six")    */
  463.     kESCSixMSB2                    = 0x0B,                            /* MultiScan Band-2 (13" thru 19")        */
  464.     kESCSixMSB3                    = 0x23,                            /* MultiScan Band-3 (13" thru 21")        */
  465.     kESCSixStandard                = 0x2B,                            /* 13"/14" RGB or 12" Monochrome        */
  466.     kESCSevenPAL                = 0x00,                            /* PAL                                    */
  467.     kESCSevenNTSC                = 0x14,                            /* NTSC                                 */
  468.     kESCSevenVGA                = 0x17,                            /* VGA                                     */
  469.     kESCSeven16Inch                = 0x2D,                            /* 16" RGB (GoldFish)                      */
  470.     kESCSevenPALAlternate        = 0x30,                            /* PAL (Alternate)                         */
  471.     kESCSeven19Inch                = 0x3A,                            /* Third-Party 19モ                        */
  472.     kESCSevenNoDisplay            = 0x3F                            /* No display connected                 */
  473. };
  474.  
  475. /* DepthMode
  476.     This abstract data type is used to to reference RELATIVE pixel depths.
  477.     Its definition is largely derived from its past usage, analogous to 'xxxVidMode'
  478.  
  479.     Bits per pixel DOES NOT directly map to 'DepthMode'  For example, on some
  480.     graphics hardware, 'kDepthMode1' may represent 1 BPP, whereas on other
  481.     hardware, 'kDepthMode1' may represent 8BPP.
  482.  
  483.     DepthMode IS considered to be ordinal, i.e., operations such as <, >, ==, etc.
  484.     behave as expected.  The values of the constants which comprise the set are such
  485.     that 'kDepthMode4 < kDepthMode6' behaves as expected.
  486. */
  487. typedef unsigned short DepthMode;
  488.  
  489.  
  490. enum {
  491.     kDepthMode1                    = 128,
  492.     kDepthMode2                    = 129,
  493.     kDepthMode3                    = 130,
  494.     kDepthMode4                    = 131,
  495.     kDepthMode5                    = 132,
  496.     kDepthMode6                    = 133
  497. };
  498.  
  499. enum {
  500.     kFirstDepthMode                = 128,                            /* These constants are obsolete, and just included    */
  501.     kSecondDepthMode            = 129,                            /* for clients that have converted to the above        */
  502.     kThirdDepthMode                = 130,                            /* kDepthModeXXX constants.                            */
  503.     kFourthDepthMode            = 131,
  504.     kFifthDepthMode                = 132,
  505.     kSixthDepthMode                = 133
  506. };
  507.  
  508. struct VDPageInfo {
  509.     short                            csMode;                        /*(word) mode within device*/
  510.     long                            csData;                        /*(long) data supplied by driver*/
  511.     short                            csPage;                        /*(word) page to switch in*/
  512.     Ptr                                csBaseAddr;                    /*(long) base address of page*/
  513. };
  514. typedef struct VDPageInfo VDPageInfo;
  515.  
  516. typedef VDPageInfo *VDPgInfoPtr;
  517.  
  518. struct VDSizeInfo {
  519.     short                            csHSize;                    /*(word) desired/returned h size*/
  520.     short                            csHPos;                        /*(word) desired/returned h position*/
  521.     short                            csVSize;                    /*(word) desired/returned v size*/
  522.     short                            csVPos;                        /*(word) desired/returned v position*/
  523. };
  524. typedef struct VDSizeInfo VDSizeInfo;
  525.  
  526. typedef VDSizeInfo *VDSzInfoPtr;
  527.  
  528. struct VDSettings {
  529.     short                            csParamCnt;                    /*(word) number of params*/
  530.     short                            csBrightMax;                /*(word) max brightness*/
  531.     short                            csBrightDef;                /*(word) default brightness*/
  532.     short                            csBrightVal;                /*(word) current brightness*/
  533.     short                            csCntrstMax;                /*(word) max contrast*/
  534.     short                            csCntrstDef;                /*(word) default contrast*/
  535.     short                            csCntrstVal;                /*(word) current contrast*/
  536.     short                            csTintMax;                    /*(word) max tint*/
  537.     short                            csTintDef;                    /*(word) default tint*/
  538.     short                            csTintVal;                    /*(word) current tint*/
  539.     short                            csHueMax;                    /*(word) max hue*/
  540.     short                            csHueDef;                    /*(word) default hue*/
  541.     short                            csHueVal;                    /*(word) current hue*/
  542.     short                            csHorizDef;                    /*(word) default horizontal*/
  543.     short                            csHorizVal;                    /*(word) current horizontal*/
  544.     short                            csHorizMax;                    /*(word) max horizontal*/
  545.     short                            csVertDef;                    /*(word) default vertical*/
  546.     short                            csVertVal;                    /*(word) current vertical*/
  547.     short                            csVertMax;                    /*(word) max vertical*/
  548. };
  549. typedef struct VDSettings VDSettings;
  550.  
  551. typedef VDSettings *VDSettingsPtr;
  552.  
  553. struct VDDefMode {
  554.     UInt8                            csID;
  555.     SInt8                            filler;
  556. };
  557. typedef struct VDDefMode VDDefMode;
  558.  
  559. typedef VDDefMode *VDDefModePtr;
  560.  
  561. struct VDSyncInfoRec {
  562.     UInt8                            csMode;
  563.     UInt8                            csFlags;
  564. };
  565. typedef struct VDSyncInfoRec VDSyncInfoRec;
  566.  
  567. typedef VDSyncInfoRec *VDSyncInfoPtr;
  568.  
  569. typedef unsigned long DisplayModeID;
  570.  
  571. typedef unsigned long VideoDeviceType;
  572.  
  573. typedef unsigned long GammaTableID;
  574.  
  575. /* Constants for the GetNextResolution call */
  576.  
  577. enum {
  578.     kDisplayModeIDCurrent        = 0x0,                            /* Reference the Current DisplayModeID */
  579.     kDisplayModeIDInvalid        = 0xffffffff,                    /* A bogus DisplayModeID in all cases */
  580.     kDisplayModeIDFindFirstResolution = 0xfffffffe,                /* Used in cscGetNextResolution to reset iterator */
  581.     kDisplayModeIDNoMoreResolutions = 0xfffffffd                /* Used in cscGetNextResolution to indicate End Of List */
  582. };
  583.  
  584. /* Constants for the GetGammaInfoList call */
  585. enum {
  586.     kGammaTableIDFindFirst        = 0xfffffffe,                    /* Get the first gamma table ID */
  587.     kGammaTableIDNoMoreTables    = 0xfffffffd,                    /* Used to indicate end of list */
  588.     kGammaTableIDSpecific        = 0x0                            /* Return the info for the given table id */
  589. };
  590.  
  591. struct VDResolutionInfoRec {
  592.     DisplayModeID                    csPreviousDisplayModeID;    /* ID of the previous resolution in a chain */
  593.     DisplayModeID                    csDisplayModeID;            /* ID of the next resolution */
  594.     unsigned long                    csHorizontalPixels;            /* # of pixels in a horizontal line at the max depth */
  595.     unsigned long                    csVerticalLines;            /* # of lines in a screen at the max depth */
  596.     Fixed                            csRefreshRate;                /* Vertical Refresh Rate in Hz */
  597.     DepthMode                        csMaxDepthMode;                /* 0x80-based number representing max bit depth */
  598.     unsigned long                    csResolutionFlags;            /* Reserved - flag bits */
  599.     unsigned long                    csReserved;                    /* Reserved */
  600. };
  601. typedef struct VDResolutionInfoRec VDResolutionInfoRec;
  602.  
  603. typedef VDResolutionInfoRec *VDResolutionInfoPtr;
  604.  
  605. struct VDVideoParametersInfoRec {
  606.     DisplayModeID                    csDisplayModeID;            /* the ID of the resolution we want info on */
  607.     DepthMode                        csDepthMode;                /* The bit depth we want the info on (0x80 based) */
  608.     VPBlockPtr                        csVPBlockPtr;                /* Pointer to a video parameter block */
  609.     unsigned long                    csPageCount;                /* Number of pages supported by the resolution */
  610.     VideoDeviceType                    csDeviceType;                /* Device Type:  Direct, Fixed or CLUT; */
  611.     unsigned long                    csReserved;                    /* Reserved */
  612. };
  613. typedef struct VDVideoParametersInfoRec VDVideoParametersInfoRec;
  614.  
  615. typedef VDVideoParametersInfoRec *VDVideoParametersInfoPtr;
  616.  
  617. struct VDGammaInfoRec {
  618.     GammaTableID                    csLastGammaID;                /* the ID of the previous gamma table */
  619.     GammaTableID                    csNextGammaID;                /* the ID of the next gamma table */
  620.     Ptr                                csGammaPtr;                    /* Ptr to a gamma table data */
  621.     unsigned long                    csReserved;                    /* Reserved */
  622. };
  623. typedef struct VDGammaInfoRec VDGammaInfoRec;
  624.  
  625. typedef VDGammaInfoRec *VDGammaInfoPtr;
  626.  
  627. struct VDGetGammaListRec {
  628.     GammaTableID                    csPreviousGammaTableID;        /* ID of the previous gamma table */
  629.     GammaTableID                    csGammaTableID;                /* ID of the gamma table following csPreviousDisplayModeID */
  630.     unsigned long                    csGammaTableSize;            /* Size of the gamma table in bytes */
  631.     char                            *csGammaTableName;            /* Gamma table name (c-string) */
  632. };
  633. typedef struct VDGetGammaListRec VDGetGammaListRec;
  634.  
  635. typedef VDGetGammaListRec *VDGetGammaListPtr;
  636.  
  637. struct VDRetrieveGammaRec {
  638.     GammaTableID                    csGammaTableID;                /* ID of gamma table to retrieve */
  639.     GammaTbl                        *csGammaTablePtr;            /* Location to copy desired gamma to */
  640. };
  641. typedef struct VDRetrieveGammaRec VDRetrieveGammaRec;
  642.  
  643. typedef VDRetrieveGammaRec *VDRetrieveGammaPtr;
  644.  
  645. struct VDSetHardwareCursorRec {
  646.     void                            *csCursorRef;                /* reference to cursor data */
  647.     UInt32                            csReserved1;                /* reserved for future use */
  648.     UInt32                            csReserved2;                /* should be ignored */
  649. };
  650. typedef struct VDSetHardwareCursorRec VDSetHardwareCursorRec;
  651.  
  652. typedef VDSetHardwareCursorRec *VDSetHardwareCursorPtr;
  653.  
  654. struct VDDrawHardwareCursorRec {
  655.     SInt32                            csCursorX;                    /* x coordinate */
  656.     SInt32                            csCursorY;                    /* y coordinate */
  657.     UInt32                            csCursorVisible;            /* true if cursor is must be visible */
  658.     UInt32                            csReserved1;                /* reserved for future use */
  659.     UInt32                            csReserved2;                /* should be ignored */
  660. };
  661. typedef struct VDDrawHardwareCursorRec VDDrawHardwareCursorRec;
  662.  
  663. typedef VDDrawHardwareCursorRec *VDDrawHardwareCursorPtr;
  664.  
  665. struct VDSupportsHardwareCursorRec {
  666.     UInt32                            csSupportsHardwareCursor;
  667. /* true if hardware cursor is supported */
  668.     UInt32                            csReserved1;                /* reserved for future use */
  669.     UInt32                            csReserved2;                /* must be zero */
  670. };
  671. typedef struct VDSupportsHardwareCursorRec VDSupportsHardwareCursorRec;
  672.  
  673. typedef VDSupportsHardwareCursorRec *VDSupportsHardwareCursorPtr;
  674.  
  675. struct VDHardwareCursorDrawStateRec {
  676.     SInt32                            csCursorX;                    /* x coordinate */
  677.     SInt32                            csCursorY;                    /* y coordinate */
  678.     UInt32                            csCursorVisible;            /* true if cursor is visible */
  679.     UInt32                            csCursorSet;                /* true if cursor successfully set by last set control call */
  680.     UInt32                            csReserved1;                /* reserved for future use */
  681.     UInt32                            csReserved2;                /* must be zero */
  682. };
  683. typedef struct VDHardwareCursorDrawStateRec VDHardwareCursorDrawStateRec;
  684.  
  685. typedef VDHardwareCursorDrawStateRec *VDHardwareCursorDrawStatePtr;
  686.  
  687. struct VDConvolutionInfoRec {
  688.     DisplayModeID                    csDisplayModeID;            /* the ID of the resolution we want info on */
  689.     DepthMode                        csDepthMode;                /* The bit depth we want the info on (0x80 based) */
  690.     unsigned long                    csPage;
  691.     UInt32                            csFlags;
  692.     UInt32                            csReserved;
  693. };
  694. typedef struct VDConvolutionInfoRec VDConvolutionInfoRec;
  695.  
  696. typedef VDConvolutionInfoRec *VDConvolutionInfoPtr;
  697.  
  698. struct VDPowerStateRec {
  699.     unsigned long                    powerState;
  700.     unsigned long                    powerFlags;
  701.     unsigned long                    powerReserved1;
  702.     unsigned long                    powerReserved2;
  703. };
  704. typedef struct VDPowerStateRec VDPowerStateRec;
  705.  
  706. typedef VDPowerStateRec *VDPowerStatePtr;
  707.  
  708.  
  709. #if PRAGMA_IMPORT_SUPPORTED
  710. #pragma import off
  711. #endif
  712.  
  713. #if PRAGMA_ALIGN_SUPPORTED
  714. #pragma options align=reset
  715. #endif
  716.  
  717. #ifdef __cplusplus
  718. }
  719. #endif
  720.  
  721. #endif /* __VIDEO__ */
  722.